-
Notifications
You must be signed in to change notification settings - Fork 7.6k
drivers: display: stm32_ltdc: mask irq if necessary #90972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f16d399
to
8ebd91a
Compare
8ebd91a
to
22bc468
Compare
checked on stm32f746g, stm32h7b3i. with lvgl:
|
@ markussmST FYI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patch. Makes perfectly sense to me.
Maybe being a bit more explicit in the commit title would help as well to mention that irq is masked when not necessary (not completely) ?
drivers/display/display_stm32_ltdc.c
Outdated
@@ -223,7 +224,10 @@ static int stm32_ltdc_write(const struct device *dev, const uint16_t x, | |||
|
|||
data->pend_buf = pend_buf; | |||
|
|||
__HAL_LTDC_CLEAR_FLAG(&data->hltdc, LTDC_FLAG_LI); | |||
irq_enable(config->irqn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than turn off the whole interrupt line at the NVIC level, what about simply disabling at the source, hence at the LTDC level.
This could be something like:
__HAL_LTDC_CLEAR_FLAG(&data->hltdc, LTDC_FLAG_LI);
__HAL_LTDC_ENABLE_IT(&data->hltdc, LTDC_IT_LI);
k_sem_take(...)
__HAL_LTDC_DISABLE_IT(&data->hltdc, LTDC_IT_LI);
Avoid calling __HAL_LTDC_ENABLE_IT(&data->hltdc, LTDC_IT_LI); at the ltdc init time is also necessary.
That done, if for some reason others interrupts are still needed it is still possible to handle them and only the LI interrupt is masked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for such a valuable input. Masking just a particular signal looking much more clean - done
@avolmat-st could you be so kind to take another look?
LTDC interrupt routine is used to reload frame buffer pointer once full frame is finished flushing. As long as there is no need to change buffer - there is no need to disturb CPU. Thus: Enable LTDC interrupt only when new buffer is pending Signed-off-by: Pavlo Hamov <pasha.gamov@gmail.com>
22bc468
to
fc26efc
Compare
|
LTDC interrupt routine is used to reload frame buffer pointer
once full frame is finished flushing. As long as there is no
need to change buffer - there is no need to disturb CPU.
Thus: Enable LTDC interrupt only when new buffer is pending